<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Register</title>
    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/register.css') }}">
</head>
<body>
    <div class="register-container">
        <h2>注册</h2>
        {% if error %}
            <p class="error">{{ error }}</p>
        {% endif %}
        <form name="registerForm" action="/register" method="post" onsubmit="return validateForm()">
            <div class="form-group">
                <input type="text" id="username" name="username" required placeholder=" ">
                <label for="username">用户名</label>
            </div>
            <div class="form-group">
                <input type="email" id="email" name="email" required placeholder=" ">
                <label for="email">电子邮件</label>
                <button type="button" id="sendCodeBtn" onclick="sendVerificationCode()">发送验证码</button>

            </div>
            <div class="form-group">
                <input type="text" id="verification_code" name="verification_code" required placeholder=" ">
                <label for="verification_code">验证码</label>
            </div>
            <div class="form-group">
                <input type="password" id="password" name="password" required placeholder=" ">
                <label for="password">密码</label>
            </div>
            <button type="submit">注册</button>
        </form>
        <p>已有账户？<a href="/login">点击这里登录</a></p>
    </div>
    <script src="{{ url_for('static', filename='js/register.js') }}"></script>
</body>
</html>
